package com.atguigu.servlet;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet(name = "Servlet08Annotation", urlPatterns = "/Servlet08Annotation")
public class Servlet08Annotation extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("注解版 Servlet 执行了~~~");

        resp.setContentType("text/html;charset=utf-8");
        resp.getWriter().write("注解版 Servlet 执行了~~~");
    }
}
